import React, { Component } from 'react'
import { RootState } from '@/store'
import { connect } from 'react-redux'

type HomeProps = {
  token: string
}

class Home extends Component<HomeProps> {
  componentDidMount() {
    // if (this.props.token) {
    //   window.location.href = '/#/system/menu'
    // } else {
    //   window.location.href = '/#/login'
    // }
  }

  render() {
    return <React.Fragment>Home</React.Fragment>
  }
}

export default connect((state: RootState) => {
  return {
    token: state.user.token,
  }
})(Home)
